package com.jly.enums;

public enum ResponseCode {
    // 系统模块
    SUCCESS(0, "操作成功"),
    ERROR(1, "操作失败"),
    SERVER_ERROR(500, "服务器异常"),

    // 通用模块 1xxxx
    ILLEGAL_ARGUMENT(10000, "参数不合法"),
    REPETITIVE_OPERATION(10001, "请勿重复操作"),
    ACCESS_LIMIT(10002, "请求太频繁, 请稍后再试"),
    MAIL_SEND_SUCCESS(10003, "邮件发送成功"),
   NOT_EMPTY_ARGUMENT(10004, "参数不能为空"),

    // 用户模块 2xxxx
    NEED_LOGIN(20001, "登录失效"),
    USERNAME_OR_PASSWORD_EMPTY(20002, "用户名或密码不能为空"),
    USERNAME_OR_PASSWORD_WRONG(20003, "用户名或密码错误"),
    USER_NOT_EXISTS(20004, "用户不存在"),
    WRONG_PASSWORD(20005, "密码错误"),
    USER_EXISTS(20006,"用户已存在"),
    // 文件模块 3xxxx
    FILE_EMPTY(30001,"文件不能空"),
    FILE_NAME_EMPTY(30002,"文件名称不能为空"),
    FILE_MAX_SIZE(30003,"文件大小超出"),
    FILE_DOWNLOAD_FILE(30004, "文件下载失败"),

    //业务处理模块4xxxx
    BUSINESS_ERROR(40001,"业务处理失败"),

    //权限控制模块 5xxxx
    NO_PERMISSION(50001,"没有该操作权限"),

    ;

    ResponseCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    private Integer code;
    private String msg;
    public Integer getCode() {
        return code;
    }
    public void setCode(Integer code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
}